
import service from "@/utils/service";

interface IConfig {
    url:string,
    method:string,
    data?:any,
    params?:any
}

export const httpRequest = (url:string,data:any,method:string="post")=>{

    let config:IConfig = {url,method};

    if(method.toLowerCase()=="get"){
        config.params = data;
    }else{
        config.data = data;
    }

    return service(config)

}